#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QImage>
#include "tffmpegthread.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow() override;

public slots:
    void slotGetVideoFrame(const QImage &nvideoframe);
    void slotMediaFinish();
    void slotLog(const QString &nlogstr);

private:
    Ui::MainWindow *ui;
    QImage m_videoFrame;
    //FFMPEG线程
    TFFmpegThread *m_ffmpegThread = nullptr;

    bool eventFilter(QObject *object, QEvent *event) override;

private slots:
    void slotBtnOpenClicked();
    void slotBtnCloseClicked();
    void slotBtnClearLogClicked();

signals:
    void sigClose();
    void sigOpen();

};
#endif // MAINWINDOW_H
